//
//  YLStatusTableViewCell.swift
//  weiBo
//
//  Created by 杨雷 on 2016/12/5.
//  Copyright © 2016年 Yang.L. All rights reserved.
//

import UIKit

let StatusItemMargin : CGFloat = 10



class YLStatusTableViewCell: UITableViewCell {


    
    
    var statusViewModel: YLStatusViewModel? {
        didSet{
            originaView.statusViewModel = statusViewModel
            toolBar.statusViewModel = statusViewModel
            retweetView.statusViewModel = statusViewModel
        }
    }
    
    
    
    private lazy var originaView : YLStatusOriginaView = YLStatusOriginaView()
    
    private lazy var retweetView : YLStatusRetweetView = YLStatusRetweetView()
    
    private lazy var toolBar :YLStatusToolBar = YLStatusToolBar()
    
    
    
    override func awakeFromNib() {
        super.awakeFromNib()
        
    }

    override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        
        setupUI()
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    private func setupUI() {
        
        
        contentView.addSubview(originaView)
        contentView.addSubview(retweetView)
        contentView.addSubview(toolBar)
        
        
        originaView.snp.makeConstraints { (make) in
            make.left.right.top.equalTo(contentView)
            
        }
        
        retweetView.snp.makeConstraints { (make) in
            make.top.equalTo(originaView.snp.bottom)
            make.left.right.equalTo(originaView)
            
        }
        
        toolBar.snp.makeConstraints { (make) in
            make.top.equalTo(retweetView.snp.bottom)
            make.left.right.equalTo(originaView)
            make.height.equalTo(35)
            make.bottom.equalTo(contentView)
        }
        
        
        
    }
    
    
    
    
    
    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }

}
